import tkinter as tk
import time
from tkinter import messagebox
import re
root_windows =tk.Tk()
root_windows.title("YOLO登录界面")
#dstr=tk.StringVar()
#root_windows.title("测试GUI界面")
#root_windows.geometry("450x300")
#print('电脑的分辨率是%d%d'%(root_windows.winfo_screenwidth(),root_windows.winfo_screenheight()))
#root_windows.update()
#print('窗口的分辨率是%dx%d'%(root_windows.winfo_width(),root_windows.winfo_height()))
root_windows.iconbitmap('images\Junior.ico')
#root_windows["background"]="#c9c9c9"
#root_windows.config(background="#111A60")
#root_windows.attributes('-topmost',True)
#root_windows.attributes('-alpha',1)
#root_windows.maxsize(600,600)
#root_windows.minsize(50,50)
#root_windows.geometry("450x150+100+100")
root_windows.geometry("250x200+250+200")
#root_windows.resizable(0,0)
#root_windows.title("我的钟")
#root_windows.title("移动查询电话")
#spinbox高级输入框
#w=tk.Spinbox(root_windows,from_=0,to=20,increment=2,width=15,bg="#9bcd9b")
w=tk.Spinbox(root_windows,values=("python","c++","java","php"),bg="#9bcd9b")
w.pack()
#def check():
    # 获取账号和密码
#    account = entry1.get().strip()
#    password = entry2.get().strip()
   
    # 验证账号：必须为数字
#    if not account.isdigit():
#        messagebox.showwarning("输入不正确", "账号必须为数字！")
#        entry1.delete(0, tk.END)
#       return False
    
    # 验证密码：必须包含大小写字母+特殊字符，长度>=8
#    if len(password) < 8:
#        messagebox.showwarning("输入不正确", "密码长度必须至少8个字符！")
#        entry2.delete(0, tk.END)
#        return False
    
    # 检查是否包含大写字母
#    if not re.search(r'[A-Z]', password):
#        messagebox.showwarning("输入不正确", "密码必须包含至少一个大写字母！")
#        entry2.delete(0, tk.END)
#        return False
    
    # 检查是否包含小写字母
#    if not re.search(r'[a-z]', password):
#        messagebox.showwarning("输入不正确", "密码必须包含至少一个小写字母！")
#        entry2.delete(0, tk.END)
#        return False
    
    # 检查是否包含特殊字符
#    if not re.search(r'[!@#$%^&*(),.?":{}|<>]', password):
#        messagebox.showwarning("输入不正确", "密码必须包含至少一个特殊字符！")
#        entry2.delete(0, tk.END)
#        return False
    
    # 所有验证通过
#    messagebox.showinfo("输入正确", "账号和密码格式正确！")
#    return True



#label1=tk.Label(root_windows,text="账号：").grid(row=0)
#label2=tk.Label(root_windows,text="密码：").grid(row=1)

#Dy_String=tk.StringVar()

#entry1=tk.Entry(root_windows,textvariable=Dy_String,validate="focusout",validatecommand=check)
#entry2=tk.Entry(root_windows)

#entry1.grid(row=0,column=1)
#entry2.grid(row=1,column=1)
#e1=tk.Entry(root_windows)
#e2=tk.Entry(root_windows,show="*")
#e1.grid(row=0,column=1,padx=10,pady=5)
#e2.grid(row=1,column=1,padx=10,pady=5)
#def gettime():
   # dstr.set(time.strftime("%H:%M:%S"))
   # root_windows.after(1000,gettime)
#def login():
#    if check():
#      messagebox.showinfo("登录成功")
#      print(f"账号: {entry1.get()}")
#      print(f"密码: {entry2.get()}")

#login_button=tk.Button(root_windows,text="登录",command=login,width=10, bg="#4CAF50", fg="white")
#login_button.grid(row=2, column=0, columnspan=2, pady=10)
#tk.Button(root_windows,text="登录",width=10,command=login).grid(row=3,column=0,sticky="w",padx=10,pady=5)
#tk.Button(root_windows,text="退出",width=10,command=root_windows.quit).grid(row=3,column=1,sticky="e",padx=10,pady=5)
#lb=tk.Label(root_windows,textvariable=dstr,fg="green",font=("微软雅黑",85))
#lb=tk.Label(root_windows,text="1008611",fg="green",font=("宋体",20,"bold italic"),bg="#7ccd7c",
#            width=30,height=5,
#           padx=10,pady=15,borderwidth=10,relief="sunken")
#lb.pack()
#gettime()
#text=tk.Label(root_windows,text="测试界面",bg="yellow",fg="red",font=("Times",20,"bold italic"))
#text.pack()
#def click_button():
#    messagebox.showinfo(title="温馨提示",message="hello!")

#button=tk.Button(root_windows,text="点击前往",bg="#7ccd7c",width=20,height=5,command=click_button).pack()

#button.pack(side="bottom")
    


#def callback():
 #   print("hello,world!")
#button=tk.Button(root_windows,text="执行",command=callback)
#button.pack()

root_windows.mainloop()
